
import style from './css/style.module.scss'
import {get_know_item} from '../../api/knowledge'
import { useEffect,useState } from "react"

const BaseKnow_atricde = (props) => {
    const [list, setList] = useState([]);
    useEffect(() => {
        let url = window.location.pathname;
        let str = url.split('/')
        get_know_item(str[4]).then((res) => {
          setList(res.data.data);
          console.log(res.data.data);
      });
    }, []);
 
    return (
        <div className={style.baseKnow}>
            <div className={style.leftbox}>
                <span>知识小册 / 知识小测 / 文档编辑</span>
               <div className={style.mainlist}>
                  <h1>{list.title}</h1>
                  <p>{list.publishAt}</p>
                  <p>{list.content}</p>
                  <p>发布于{list.updateAt}版权信息:非商用-著名-自由转换</p>
               </div>
            </div>
            <div className={style.rightbox}>
              <h4>知识小测</h4>
               <span>文档编辑</span>
            </div>
        </div> 
    )
}

export default BaseKnow_atricde